﻿namespace Eflong.KJFiles
{
    public class DigitalState
    {
        /*
         *  开关量类型
         */
        public string Type;
        /*
         *  数值0 对应状态0
         */
        public bool bState0;
        /*
         *  正常状态
         */
        public string State0;
        /*
         *  异常状态
         */
        public string State1;

        public const string DefaultType = "开停";

        public DigitalState( string type )
        {
            Type = type;
            State0 = "1开，0停";
            State1 = "0开，1停";
            bState0 = true;
            switch ( type )
            {
                case "风机":
                case "主扇":
                case "局扇":
                case "开停":
                    State0 = "开";
                    State1 = "停";
                    break;

                case "开关":
                    State0 = "开";
                    State1 = "关";
                    break;

                case "风门":
                    State0 = "关";
                    State1 = "开";
                    break;

                case "烟雾":
                    State0 = "无烟";
                    State1 = "有烟";
                    break;

                case "风筒":
                    State0 = "正常";
                    State1 = "漏风";
                    break;

                case "断电":
                case "断电器":
                    State0 = "正常";
                    State1 = "断电";
                    break;

                case "馈电":
                case "馈电器":
                    State0 = "有电";
                    State1 = "无电";
                    break;

                case "闭锁":
                case "继电器":
                    State0 = "吸合";
                    State1 = "断开";
                    break;

                case "控制":
                case "控制器":
                    State0 = "正常";
                    State1 = "异常";
                    break;

                case "界闭":
                    State0 = "关";
                    State1 = "打开";
                    break;

                case "供电":
                    State0 = "交流";
                    State1 = "直流";
                    break;

                case "分站":
                    State0 = "正常";
                    State1 = "异常";
                    break;
                default:
                    State0 = "开";
                    State1 = "停";
                    break;
            }
        }
    }
}